Graphics processing using directional representations of lighting at probe positions within a scene

ABSTRACT

Graphics processing systems can include lighting effects when rendering images. “Light probes” are directional representations of lighting at particular probe positions in the space of a scene which is being rendered. Light probes can be determined iteratively, which can allow them to be determined dynamically, in real-time over a sequence of frames. Once the light probes have been determined for a frame then the lighting at a pixel can be determined based on the lighting at the nearby light probe positions. Pixels can then be shaded based on the lighting determined for the pixel positions.

CROSS-REFERENCE TO RELATED APPLICATIONS AND CLAIM OF PRIORITY

This application is a continuation under 35 U.S.C. 120 of copendingapplication Ser. No. 17/406,600 filed Aug. 19, 2021, now U.S. Pat. No.11,734,879, which is a continuation of prior application Ser. No.16/858,942 filed Apr. 27, 2020, now U.S. Pat. No. 11,127,198, which is acontinuation of prior application Ser. No. 15/987,466 filed May 23,2018, now U.S. Pat. No. 10,672,183, which is a continuation of priorapplication Ser. No. 15/059,940 filed Mar. 3, 2016, now U.S. Pat. No.10,008,032, which is a non-provisional under 35 U.S.C. 119(e) ofApplication Ser. No. 62/127,430 filed Mar. 3, 2015.

BACKGROUND

The description herein generally relates to 3-D rendering systems,system architectures, and methods. Some of the examples described hereinrelate to systems, architectures, and methods for asynchronous andconcurrent hybridized rendering, such as hybridized ray tracing andrasterization-based rendering.

Graphics Processing Units (GPUs) often provide highly parallelizedrasterization-based rendering hardware. A traditional graphicsprocessing unit (GPU) used a fixed pipeline only for rendering polygonswith texture maps and gradually evolved to a more flexible pipeline thatallows programmable vertex and fragment stages. Even though modern GPUssupport more programmability of geometry and pixel processing, a varietyof functions within a GPU are implemented in fixed function hardware.Modern GPUs can range in complexity, and may be adapted to be suited forparticular uses. When designing a GPU, there is often a trade-offbetween various factors such as performance, size, power consumption andcost. GPUs are often used in real time rendering tasks, andoptimizations for many GPU applications involve determining shortcuts toachieve a desired throughput of frames per second, while maintaining adesired level of subjective video quality. For example, in a video game,realistic modeling of light behavior is rarely an objective; rather,achieving a desired look or rendering effect is often a principalobjective.

Traditionally, ray tracing is a technique used for high quality,non-real time graphics rendering tasks, such as production of animatedmovies, or producing 2-D images that more faithfully model behavior oflight in different materials. In ray tracing, control of rendering andpipeline flexibility to achieve a desired result were often morecritical issues than maintaining a desired frame rate. Also, some of thekinds of processing tasks needed for ray tracing are not necessarilyimplementable on hardware that is well-suited for rasterization.

As an example, ray tracing is particularly suited for introducinglighting effects into rendered images. Sources of light may be definedfor a scene which cast light onto objects in the scene. Some objects mayocclude other objects from light sources resulting in shadows in thescene. Rendering using a ray tracing technique allows the effects oflight sources to be rendered accurately since ray tracing is adapted tomodel the behaviour of light in the scene.

Ray tracing rendering techniques are often relatively computationallyexpensive and memory intensive to implement, particularly if therendering is desired to be performed in real-time, and as such often raytracing techniques are not suitable for implementation on devices suchas mobile devices which have relatively tight constraints on processingcapabilities, size and/or cost.

SUMMARY

This Summary is provided to introduce a selection of concepts in asimplified form that are further described below in the DetailedDescription. This Summary is not intended to identify key features oressential features of the claimed subject matter, nor is it intended tobe used to limit the scope of the claimed subject matter.

“Light probes” are directional representations of lighting at particularprobe positions in the space of a scene which is being rendered. Forexample, a directional representation of lighting may be implemented asa spherical harmonic function which describes the lighting at thecorresponding probe position in terms of spherical harmonic components.Once the light probes have been determined for a frame then the lightingat a surface which is visible in a pixel can be determined based on thelighting from the light probes that are near the point in space visiblein the pixel. For example, an indication of the lighting for aparticular pixel may be determined based on a weighted average of a setof nearest light probes to the visible point or object. Multiple probesmay contribute values to the pixel through interpolation or a weightedaverage. The weights for the weighted average may be based on thedistance between the pixel's visible position and the respective lightprobe position. The set of nearest light probes may include light probesfor which the distance to the pixel position in world space is below athreshold value. The set of nearest light probes may include apredetermined number of light probes, for example the ten nearest lightprobes to the pixel position may be included in the set. The set oflight probes might only include light probes which are visible from thepixel position using line-of-sight calculations.

The positions of light probes may be determined by an algorithm orheuristic, they may be supplied by an artist or game designer. The lightprobe positions may be determined at run time within the game or theymay be included ahead of time as part of the game's design. Some probepositions may be specified relative to other objects within the game andsome may be specified in absolute 3-dimensional world-space.

In examples described herein the light probes are determineddynamically, i.e. in real-time, as frames are rendered. Due torestrictions on processing resources on the device on which a graphicsprocessing system is implemented, it is often infeasible for thelighting function represented by light probes to be fully calculated foreach frame, so in examples described herein, the light probes determinedfor a previous frame may be updated or partially updated for a currentframe. Determining the light probes in this manner may be sufficientlyaccurate if the difference in lighting from one frame to the next issmall, which is often the case for a sequence of frames rendered for anapplication such as a game application.

There is provided a machine-implemented method of graphics processing,comprising:

-   -   for each frame of a sequence of frames, determining visible        surfaces of a scene for pixels in the frame, from a viewpoint        for the frame;    -   for each probe position of a plurality of probe positions within        the scene, maintaining a directional representation of lighting        by:        -   tracing one or more rays from the probe position to            determine, for each of the one or more rays, a lighting            contribution for the probe position from the direction of            the ray; and        -   updating the directional representation of lighting for the            probe position based on the determined lighting contribution            for each of the one or more rays;    -   using the directional representations of lighting for the probe        positions to determine lighting indications for the determined        visible surfaces of the scene for pixels in the frame; and    -   shading the pixels in the frame in accordance with the        determined lighting indications.

The above steps may be spread over a sequence of frames and are notrequired to be performed during the processing for a single frame. Forexample, rays may be cast during one frame and the resulting data may beused during a subsequent frame.

Updating the directional representation of lighting for a probe positionmay comprise: transforming the one or more determined lightingcontributions for the one or more rays into a set of component valuesassociated with respective components of the directional representationof lighting for the probe position; and combining the component valuesfor the one or more rays with existing component values of thedirectional representation of lighting for the probe position. Thecombining of the component values for the one or more rays with existingcomponent values of the directional representation of lighting for theprobe position may comprise maintaining a running average the componentvalues of the directional representation of lighting for the probeposition over the sequence of frames.

The tracing of a ray for a probe position may comprise selecting adirection for the ray. For example, a direction for a ray may beselected randomly or pseudo-randomly, including using Monte Carlomethods and quasi-Monte Carlo methods, low discrepancy sequences, andother types of structured noise or sampling patterns. In other examplesa direction for a ray may be selected based on a selection schemewherein the directions are selected from a set of available raydirections. The selection scheme may be a round robin scheme. Theselection scheme may be biased towards selecting directions which aretowards regions of relatively high luminosity in the scene, or areas ofthe scene where the lighting conditions are known to have recentlychanged. The direction for a ray may be selected from the set ofavailable ray directions based on the respective intervals (e.g. timesor number of frames) since the available ray directions were mostrecently selected for the probe position. The direction for a ray for aparticular probe position may be selected based on directions selectedfor nearby probe positions.

In some examples, the directional representations of lighting aredefined in terms of spherical harmonic components. In other examples,the directional representations of lighting are defined in terms ofcomponents in a three-dimensional Cartesian coordinate system.

The lighting indication for a determined visible surface of the scenefor a pixel in the frame may be determined by: identifying a set ofprobe positions for the pixel, and implementing a distance-basedweighting of the directional representations of lighting for theidentified set of probe positions. Identifying a set of probe positionsfor the pixel may comprise: identifying an initial set of probepositions for which the distance between the pixel position and theprobe positions is less than a threshold distance; and identifying whichof the initial set of probe positions is visible from the pixelposition.

In some examples, the step of using the directional representations oflighting for the probe positions may comprise: determining local probedata at local probe positions within the scene based on the directionalrepresentations of lighting for the probe positions; and using the localprobe data of the local probe positions to determine the lightingindications for the determined visible surfaces of the scene for pixelsin the frame.

A local probe may correspond to a set or subset of pixels. Local probedata can be calculated from other probes and can be computed using3-dimensional methods. Those 3 dimensional methods may involvedetermining line of sight occlusions in order to weight the validity ofdata from other probes. Local probe data can allow pixel values to bemore efficiently calculated using 2-dimensional methods likeinterpolation.

There is further provided a graphics processing unit configured torender a sequence of frames, the graphics processing unit comprising:

-   -   surface identification logic configured to determine, for each        frame of the sequence of frames, visible surfaces of a scene for        pixels in the frame, from a viewpoint for the frame; and    -   processing logic configured to:        -   maintain a directional representation of lighting for each            probe position of a plurality of probe positions within the            scene, by:            -   tracing one or more rays from the probe position to                determine, for each of the one or more rays, a lighting                contribution for the probe position from the direction                of the ray; and            -   updating the directional representation of lighting for                the probe position based on the determined lighting                contribution for each of the one or more rays;        -   use the directional representations of lighting for the            probe positions to determine lighting indications for the            determined visible surfaces of the scene for pixels in the            frame; and        -   shade the pixels in the frame in accordance with the            determined lighting indications.

There is also provided a machine-implemented method of graphicsprocessing, comprising:

-   -   for each frame of a sequence of frames, determining visible        surfaces of a scene for pixels in the frame, from a viewpoint        for the frame;    -   for each probe position (which may be referred to as a        “high-level” probe position) of a plurality of probe positions        within the scene, maintaining a directional representation of        lighting (e.g. by tracing rays in the scene);    -   determining a plurality of low-level probe positions within the        3d scene based on the visible surfaces;    -   for each of the low-level probe positions, determining        directional lighting representations at its position by        incorporating data from one or more of the directional        representations of lighting maintained for probe positions        within the scene;    -   using the directional representations of lighting for the        low-level probe positions to determine lighting indications for        the determined visible surfaces of the scene for pixels in the        frame; and    -   shading the pixels in the frame in accordance with the        determined lighting indications.

There is provided the above method wherein the density of low-levelprobe positions is greater than the density of high-level probepositions within a local region of world-space.

The lighting indication for the visible surface for a pixel may bedetermined by interpolating in 2 dimensions between the directionalrepresentations of lighting for a set of low-level probe positions forthe pixel. Selection of valid local probes for interpolation may involvedetermining whether they are similar to the pixel's visible surface withregard to world-space position or depth from the virtual camera.Alternatively similarity to the visible surface may be a weightingfactor used in the interpolation.

There is provided a machine-implemented method of graphics processing,comprising:

-   -   for each probe position of a plurality of probe positions within        the scene, maintaining a directional representation of lighting        by:        -   tracing one or more rays from the probe position to            determine, for each of the one or more rays, a lighting            contribution for the probe position from the direction of            the ray; and        -   updating the directional representation of lighting for the            probe position based on the determined lighting contribution            for each of the one or more rays;        -   wherein the updating comprises a form of averaging between            the ray contribution data and existing probe lighting data.

There is provided the method above wherein the rays are biased towardsdirections of increased importance and the averaging accounts for thechange in probability.

There is also provided a non-transitory computer readable storage mediumhaving stored thereon a computer readable description of an integratedcircuit that, when processed in an integrated circuit manufacturingsystem, causes the integrated circuit manufacturing system tomanufacture a graphics processing unit as described in any of theexamples herein. The graphics processing units described herein may beembodied in hardware.

There may be provided computer program code for performing any of themethods described herein. There may be provided non-transitory computerreadable storage medium having stored thereon computer readableinstructions that, when executed at a computer system, cause thecomputer system to perform any of the methods described herein.

The above features may be combined as appropriate, as would be apparentto a person skilled in the art, and may be combined with any of theaspects of the examples described herein.

BRIEF DESCRIPTION OF THE DRAWINGS

Examples will now be described in detail with reference to theaccompanying drawings in which:

FIG. 1 shows a graphics processing system;

FIG. 2 is a flow chart for a method of graphics processing;

FIG. 3 illustrates a scene to be rendered from a viewpoint;

FIG. 4 shows a computer system in which a graphics processing system isimplemented; and

FIG. 5 shows an integrated circuit manufacturing system for generatingan integrated circuit embodying a graphics processing system.

The accompanying drawings illustrate various examples. The skilledperson will appreciate that the illustrated element boundaries (e.g.,boxes, groups of boxes, or other shapes) in the drawings represent oneexample of the boundaries. It may be that in some examples, one elementmay be designed as multiple elements or that multiple elements may bedesigned as one element. Common reference numerals are used throughoutthe figures, where appropriate, to indicate similar features.

DETAILED DESCRIPTION

The following description is presented by way of example to enable aperson skilled in the art to make and use the invention. The presentinvention is not limited to the embodiments described herein and variousmodifications to the disclosed embodiments will be apparent to thoseskilled in the art.

Embodiments will now be described by way of example only.

FIG. 1 illustrates a graphics processing system 100 which comprises agraphics processing unit 102 and a memory 104. The graphics processingunit 102 comprises surface identification logic 106, processing logic108, an image buffer 110 and control logic 112. The surfaceidentification logic is configured to identify surfaces within a scenebeing rendered. The processing logic 108 comprises one or more executioncores and is configured to process graphics data for surfaces identifiedby the surface identification logic 106. The image buffer is configuredto store rendered pixel values. The control logic 112 is configured tocontrol the operation of the graphics processing system 100.

An example of the operation of the graphics processing system 100 isdescribed with reference to the flow chart in FIG. 2 .

Graphics data representing objects in a scene is received at thegraphics processing unit 102. The graphics data may comprise primitiveswhich represent surfaces of objects to be rendered. Primitives are oftentriangles, but can take other forms, e.g. other two-dimensional shapes,or points or lines. A primitive may be defined by a set of vertices,e.g. three vertices define a triangular primitive. The graphics data mayinclude vertex data (e.g. position data and attribute data, such astexture data) for the vertices of the primitives in the scene andindications for the primitives to indicate which of the vertices formthe primitives.

In step S202 the surface identification logic 106 identifies visiblesurfaces for pixels of a frame. In other words, a frame is to berendered to represent a view of the scene from a particular viewpoint,and the frame comprises an array of pixel positions. For each pixelposition of the frame, a surface in the scene which is primarily visiblein that pixel is identified in step S202. Indications of the visiblesurfaces for the pixels are provided from the surface identificationlogic 106 to the processing logic 108. One or more different methods maybe used by the surface identification logic 106 to identify visiblesurfaces for the pixels in the scene, e.g. rasterisation or ray tracingmay be used to identify visible surfaces. Methods of rasterisation andmethods of ray tracing for identifying visible surfaces for pixels areknown in the art, and as such for conciseness, the details of thosemethods are not described in detail herein.

FIG. 3 shows an example of a scene 302 which a surface 304. This is avery simple example, and in other examples there would likely be manymore surfaces and objects within the scene. FIG. 3 shows two lightsources 306 ₁ and 306 ₂ which illuminate objects in the scene. Theviewpoint from which the scene is viewed is shown at 308 and the viewplane of the frame to be rendered is represented at 310. The black dots(one of which is denoted 312) represent light probes in the scene 302.The light probes may be distributed throughout the scene 302, e.g.according to a predetermined pattern, and may for example be positionedby an artist or scene generation tool. For example, an artist designingthe scene 302 may identify suitable positions within the scene 302 forlight probes to be positioned.

The lighting at the probe positions can be determined and stored, andthen the lighting at visible surfaces identified for pixel positions canbe determined based on the lighting at the probe positions. The use oflight probes in this manner can greatly simplify the processing involvedin determining the lighting at the visible surfaces identified for thepixels positions. In contrast to light maps, light probes are nottypically attached to any particular surface within the scene 302, andas such are not affected by surface normals of surfaces in the scene302.

In step S204, for a probe position 312, the processing logic 108 tracesone or more rays from the probe position to determine a lightingcontribution for the probe position from the direction of the ray(s).The tracing of the rays may involve direct evaluation of the lighting onthe intersected surface, it may involve path tracing, or it may involveretrieving data from an additional lighting structure e.g. a lightmap,and possibly a structure comprising probes.

In methods described herein, the number of rays which are traced from aprobe position for a frame may be fewer than would be needed toaccurately describe an omnidirectional representation of the lighting atthe probe position without any additional information. As an example,fewer than five rays may be traced in step S204 for a particular probeposition, such that the amount of processing involved in step S204 isnot prohibitive for implementing the method in real-time. As will bedescribed below, the data determined in step S204 for a probe positionis combined with previously determined data for the probe position fromprevious frames in order to determine a sufficiently accurateomnidirectional representation of lighting at the probe position. Inthis sense, the value of light probes is progressively refined over asequence of frames. In other words, a progressive refinement approach isadopted whereby each ray contributes to an average that ultimatelyconverges on the correct value. This is in contrast to prior art systemswhich attempt to compute the entire value of a light probe in onesequence of operations. Methods described herein can apply as much (oras little) processing power depending on availability and requirementfor accuracy.

In step S204 the processing logic 108 may select the directions of therays to be traced. There are many ways in which the directions for therays may be selected. For example, the directions may be selectedrandomly (including pseudo-randomly). Alternatively, the directions maybe selected with a view to providing the most useful information forupdating a previously stored representation of the lighting at the probeposition. For example, the directions may be selected from a set ofavailable ray directions, e.g. all of the 3D directions may be quantisedinto a finite set of ray directions from which directions can beselected for rays. A round robin selection scheme could be used suchthat each direction is selected in turn over a number of frames. Thiscan ensure an even sampling of the different ray directions over asequence of frames. Alternatively a low discrepancy sequence or anotherquasi-monte-carlo method or structured noise approach could be used toachieve even coverage of the sampling space. A different selectionscheme may be biased towards selecting directions which are towardsregions of relatively high luminosity, e.g. towards the light sources306 ₁ and 306 ₂ or towards regions with brighter reflections. Regions ofrelatively high luminosity are likely to contribute more to the lightingat a probe position than regions of lower luminosity, so it may bebeneficial to sample the higher luminosity regions more often than lowerluminosity regions. Alternative importance indicators may also be usefulto guide sampling. These include knowledge of change in scene lightingcaused by moving lights, changing lights, moving objects, etc. Theselection scheme may take into account an interval (e.g. an amount oftime, or a number of frames) since the rays were most recently selectedfor a probe position. This can ensure that some ray directions are notneglected for a long time. Furthermore, the selection scheme may selectdirections for rays to be traced for a probe position based ondirections selected for nearby probe positions.

In step S206 the processing logic 108 transforms the lightingcontributions for the rays traced in step S204 into a set of componentvalues associated with respective components of the directionalrepresentation of lighting for the probe position. For example, thedirectional representation of lighting for a probe position may bedefined in terms of spherical harmonic components. Spherical harmonicfunctions are known in the art. In this example, the spherical harmonicfunction representing lighting at a probe position is a function thatcan take a 3D direction as an input and provide a lighting indication(e.g. an intensity) for light received at the probe position from the 3Ddirection. Spherical harmonic functions are a good way of storingdirectional functions with a small amount of storage requirements forthe components of the function.

In another example, the directional representation of lighting for aprobe position may be defined in terms of components in a 3D Cartesiancoordinate system, e.g. such that the components are defined along thex, y and z axes.

Methods for implementing the transformation of step S206 would be knownto a person skilled in the art. For example, the steps of transforming alighting indication from a particular ray direction into a set ofspherical harmonic components are known in the art.

In step S208 the component values determined in step S206 are combinedwith existing component values of the directional representation oflighting for the probe position. The existing component values may bestored from a previous frame of the sequence of frames being rendered.For example, a running average may be maintained for the componentvalues of the directional representation of lighting for the probeposition over the sequence of frames. The weighting with which thecomponent values determined for the current frames are combined with theexisting component values may be fixed, or may vary depending thesimilarity in between the frames. For example, if the scene isrelatively static then previous lighting estimates are likely to be morevalid than if the scene is relatively dynamic. Therefore, if the sceneis relatively static then previous component values of therepresentation of lighting may be weighted more heavily than if thescene is relatively dynamic.

The weighting by which the new samples affect the old samples may becalculated as a function of the tolerance for stale lighting data in theprobes. If the lighting conditions change slowly, existing data would beweighted more heavily in order to represent more valid data in the probeand achieve a smoother and more accurate average. Likewise when thelighting data changes quickly, the relative weighting can be adjusted.

In a situation where it is not desirable for the old lighting data todecay, an average may be computed whereby the sum of lighting from therays is tracked separately from the number of rays in the average andthe division is performed as the probe data is needed. This gives equalweighting to old samples and new samples and will provide a continuouslyrefining average.

Steps S206 and S208 together can be seen as updating the directionalrepresentation of lighting for a probe position based on the determinedlighting contribution for each of the rays traced in step S204 for theprobe position. The directional representations of lighting for theprobe positions are stored.

The light probes (or “directional representations of lighting”) may becapable of storing direct and/or indirect lighting information, but insome examples the light probes only store indirect lighting information.

In step S210 the processing logic 108 determines whether there are moreprobe positions to be resolved for the current frame. If there are moreprobe positions then the method passes back to step S204 and repeats forthe next probe position. Although this diagram illustrates the processas serial, modern graphics processing systems may perform manycomputations in parallel. When step S210 determines that there are nomore probe positions to be resolved for the current frame then themethod passes to step S212. At this point a set of light probes 312 havebeen resolved for the current frame which indicate a directionalrepresentation of light passing through the probe positions 312 withinthe scene 302. If an object was located at a probe position then itwould be lit by the light indicated by the appropriate light probe. Forsurfaces of objects that are not located at a probe position thelighting can be determined using a combination of light probes, asdescribed below.

In step S212, for each of the pixels, the processing logic identifies aset of probe positions. For example, probe positions which are nearbythe visible surface identified for a pixel in step S202 are identified.In this way the nearest light probes in world space to the surface whichis visible at the pixel are identified.

In step S214 the processing logic determines a lighting indication forthe surfaces of the scene for the pixels using a weighted combination ofthe directional representations of lighting for the set of probepositions identified for the pixels. The weighted combination could be adistance-based weighting, e.g. where the weights can be based on 1/d or1/d² where d is the distance between the point on a surface (e.g.surface 304) which is visible in a pixel and the probe position.Furthermore, a distance falloff threshold may be included in theweighted combination, whereby once the threshold has been crossed, thecontribution of a light probe to a pixel's lighting is tapered quicklybut smoothly to zero. This avoids jarring changes when a probe is movedinto or out of the set of probes under consideration affecting the totalweight.

Once a lighting indication has been determined for a pixel, in step S216the processing logic 108 shades the pixel to determine a rendered pixelvalue. The rendering process includes applying lighting to the pixel inaccordance with the lighting indication determined for the pixel. Therendered pixel values can be stored in the image buffer 110. When all ofthe pixels of a frame have been rendered the frame may be output fromthe image buffer 110, e.g. to be stored in the memory 104 and/or fordisplay on a display and/or for transmission to another device.

The identification of the set of probe positions for a pixel in stepS212 may also take into account the visibility of the probe positionfrom the surface 304 which is visible in the pixel. For example, if anobject moves to completely surround a probe then there will be verylittle light reaching the probe. That probe will be dark, and, ifvisibility were not taken into account, points on the object's surfacecould then be incorrectly darkened by including the probe's informationin their average. In the case of a completely dark probe, the answer iseasy: the probe is effectively disabled and doesn't contribute to thelighting of the pixels. However, in a more ambiguous situation, thesolution isn't as simple unless the visibility of the probe position fora pixel is taken into account. For example, an initial set of probepositions could be identified for a pixel for which the distance betweenthe pixel position and the probe positions is less than a thresholddistance. Then that initial set of probes can be reduced by identifyingwhich of the initial set of probe positions is visible from the pixelposition, such that the remaining set of probe positions only includesprobe positions that are visible from the pixel position. The visibilityof the probe positions from the pixel position may be determined bytracing rays between the pixel position and the probe positions todetermine whether the rays intersect any occluding geometry. This workswell, but involves evaluating intersection tests at a number of samplepoints along rays from a pixel position to each initial probe position,so the processing cost may be relatively high.

Another solution to the problem of probe occlusion involves allowing anartist or content creation tool to specify a volume of effect forprobes. For example, some probes could effect a large radius if theywere positioned in the center of a room, while other probes near asurface may have a much smaller radius of effect. In addition, thevolume of effect can be a non-spherical volume, for example a box, atetrahedron, a parametric volume, or even a volume described withconstructive solid geometry operations.

As described above, the positions of the light probes 312 are defined inthe world-space of the scene 302, e.g. according to a predeterminedpattern, or as determined by an artist or scene generation tool. In someexamples, the light probes could be positioned to follow particularelements of geometry in the scene 302 which are of interest. Forexample, a character in a game application may be an element of geometryof interest, and have a strong effect on the lighting in the immediatevicinity of the character. The lighting effects on a surface may be moreaccurately determined if there are light probes near to the surface inthe scene, and/or if the density of light probes is high in the regionsurrounding the surface. Therefore, by determining the position of somelight probes based on the position of elements of geometry which are ofinterest, the accuracy of the determination of the lighting on thesurfaces of the geometry of interest can be improved. In this way, moreprobes are provided in regions where more detail in the lighting isparticularly beneficial to the perceived quality of the image. Byallowing light probes to follow geometry of interest, the lighting indynamic scenes can be modelled accurately for regions of interest.

Steps S212 and S214 can collectively be considered to be using thedirectional representations of lighting for the probe positions todetermine lighting indications for the determined visible surfaces ofthe scene for pixels in the frame. One approach to reducing theprocessing cost of performing steps S212 and S214 is to use “localprobes” or “low-level probes”. The probes described above (e.g. probes312 shown in FIG. 3 ) can be considered to be “global probes” or“high-level probes”. As described above, for each of the high-levelprobes, a directional representation of lighting is maintained bytracing rays in the scene. The low-level probes are positioned in thescene based on the world-space positions shown by the pixels. Forexample, the low-level probe positions can be determined based on aprojection of pixel positions into the scene. As an example, a low-levelprobe position can be determined for each 16×16 block of pixels.

A collection of local probes (i.e. low-level probes) can be representedas a low resolution screenspace buffer temporarily storing probe-likedata that is then used as an interpolation source for individual pixels.When the positions of the local probes has been determined for a frame,the positions may remain constant in world-space over a sequence offrames, such that new local probe positions are not generated for eachframe which could result in temporal aliasing. If new local probepositions were re-generated for each frame, the lighting might “shimmer”or “sizzle” because of minor variations in the positions of the localprobes as the camera moves (i.e. as the viewpoint 308 moves). To correctfor this, the buffer of low-level probes is reprojected to account forchanges in the camera viewpoint. The density of the low-level probepositions is often greater than the density of high-level probes in alocal region of world-space near the visible surfaces. This means that avisible surface for a pixel position tends to be closer to a set oflocal probes than to a set of global probes. Therefore, determining thelighting at a pixel position (e.g. based on interpolation of lighting atprobe positions) tends to be more accurate if the interpolation is overlocal probes rather than global probes. A directional representation oflighting is determined for each of the low-level probe positions basedon the directional representations of lighting for a plurality of thehigh-level probe positions. For example the lighting at the local probepositions can be determined based on a weighting of nearby globalprobes. In some examples, local probes are based on a combination ofglobal probes within a distance threshold and which are visible form thelocal probe position. Occlusion testing of a subset of the global probesfrom a local probe position can be performed using ray tracing todetermine which of the subset of global probe positions are visible fromthe local probe position. As an example, the subset may include thetwelve nearest global probes for a local probe, and the occlusiontesting determines which of those twelve global probes have a directline of sight to the local probe position, and then those visible globalprobes are combined to determine the directional representation oflighting at the local probe position.

One advantage of using local probes to aggregate data from one or moreglobal probes is to allow costly operations like line-of-sightdeterminations for occluded probes to be determined less frequently andamortized across a larger number of visible pixels.

Once the directional representations of lighting at the local probepositions have been determined (i.e. once the local probes have been“resolved”), they can be used as described above to determine lightingindications for the determined visible surfaces of the scene for pixelsin the frame. This may involve interpolating between the directionalrepresentations of lighting for a set of nearest low-level probepositions for a pixel. Since the density of local probes is higher thanthe density of global probes, a simple interpolation between localprobes may be sufficiently accurate for determining the lighting at apixel position, without interpolation artifacts being noticeable. Insome cases it may be sufficient to perform the interpolation in2-dimensional screen-space, provided a consistency check validates thatthe local probe and the visible surface are near enough to each other inworld-space to be representative. In addition, some undesirableartefacts can be avoided by associating multiple local probes atdifferent distances from the camera, when necessary, near the surfacesvisible in a given region of pixels.

Once lighting has been interpolated for a pixel, the pixels can beshaded as described above in accordance with the determined lightingindications.

The processing logic 108 may ensure that all of the pixels in theviewplane 210 are within the influence of a sufficient number of localprobes. If this is not initially the case for a pixel then additionallocal probes can be deposited in the scene 302 near the visible surfacefor the pixel. For example, this could be done using a screenspacefilter. A depth-percentage-threshold could be used to determine if alocal probe qualified as being within range or not. If there are not asufficient number of local probes (e.g. at least 3) that a given samplepixel could interpolate between, additional local probes can bedeposited for the sample pixel with different camera depth positionvalues, in order to put them within range of the visible surface for thesample pixel.

As mentioned above, to avoid temporal aliasing, the local probes mayremain locked in world-space, even when the camera moves. Local probesthat are no longer visible can be deallocated, and new local probes canbe created for new areas of the screen that don't already have any localprobes. The local probes may be stored as a deep, low-resolutionscreenspace buffer. Every time the camera moves, he buffer isre-projected and the gaps can be filled in by creating new local probes.An equally valid approach for storing the local probes is to use a 3Dstorage and lookup structure like a grid, a kd tree, or any other kindof 3d spatial structure.

FIG. 4 shows a computer system in which the graphics processing systemsdescribed herein may be implemented. The computer system comprises a CPU402, a GPU 404, a memory 406 and other devices 408, such as a display410, speakers 412 and a camera 414. The GPU 404 may correspond with theGPU 102 described above. The memory 406 may correspond with the memory104 described above. The components of the computer system cancommunicate with each other via a communications bus 416.

The graphics processing unit 102 is shown as comprising a number offunctional blocks. This is schematic only and is not intended to definea strict division between different logic elements of such entities.Each functional block may be provided in any suitable manner. It is tobe understood that intermediate values described herein as being formedby a graphics processing unit need not be physically generated by thegraphics processing unit at any point and may merely represent logicalvalues which conveniently describe the processing performed by thegraphics processing unit between its input and output.

The graphics processing units described herein may be embodied inhardware on an integrated circuit. The graphics processing unitsdescribed herein may be configured to perform any of the methodsdescribed herein. Generally, any of the functions, methods, techniquesor components described above can be implemented in software, firmware,hardware (e.g., fixed logic circuitry), or any combination thereof. Theterms “module,” “functionality,” “component”, “element”, “unit”, “block”and “logic” may be used herein to generally represent software,firmware, hardware, or any combination thereof. In the case of asoftware implementation, the module, functionality, component, element,unit, block or logic represents program code that performs the specifiedtasks when executed on a processor. The algorithms and methods describedherein could be performed by one or more processors executing code thatcauses the processor(s) to perform the algorithms/methods. Examples of acomputer-readable storage medium include a random-access memory (RAM),read-only memory (ROM), an optical disc, flash memory, hard disk memory,and other memory devices that may use magnetic, optical, and othertechniques to store instructions or other data and that can be accessedby a machine.

The terms computer program code and computer readable instructions asused herein refer to any kind of executable code for processors,including code expressed in a machine language, an interpreted languageor a scripting language. Executable code includes binary code, machinecode, bytecode, code defining an integrated circuit (such as a hardwaredescription language or netlist), and code expressed in a programminglanguage code such as C, Java or OpenCL. Executable code may be, forexample, any kind of software, firmware, script, module or librarywhich, when suitably executed, processed, interpreted, compiled,executed at a virtual machine or other software environment, cause aprocessor of the computer system at which the executable code issupported to perform the tasks specified by the code.

A processor, computer, or computer system may be any kind of device,machine or dedicated circuit, or collection or portion thereof, withprocessing capability such that it can execute instructions. A processormay be any kind of general purpose or dedicated processor, such as aCPU, GPU, System-on-chip, state machine, media processor, anapplication-specific integrated circuit (ASIC), a programmable logicarray, a field-programmable gate array (FPGA), or the like. A computeror computer system may comprise one or more processors.

It is also intended to encompass software which defines a configurationof hardware as described herein, such as HDL (hardware descriptionlanguage) software, as is used for designing integrated circuits, or forconfiguring programmable chips, to carry out desired functions. That is,there may be provided a computer readable storage medium having encodedthereon computer readable program code in the form of an integratedcircuit definition dataset that when processed in an integrated circuitmanufacturing system configures the system to manufacture a graphicsprocessing unit configured to perform any of the methods describedherein, or to manufacture a graphics processing unit comprising anyapparatus described herein. An integrated circuit definition dataset maybe, for example, an integrated circuit description.

An integrated circuit definition dataset may be in the form of computercode, for example as a netlist, code for configuring a programmablechip, as a hardware description language defining an integrated circuitat any level, including as register transfer level (RTL) code, ashigh-level circuit representations such as Verilog or VHDL, and aslow-level circuit representations such as OASIS (RTM) and GDSII. Higherlevel representations which logically define an integrated circuit (suchas RTL) may be processed at a computer system configured for generatinga manufacturing definition of an integrated circuit in the context of asoftware environment comprising definitions of circuit elements andrules for combining those elements in order to generate themanufacturing definition of an integrated circuit so defined by therepresentation. As is typically the case with software executing at acomputer system so as to define a machine, one or more intermediate usersteps (e.g. providing commands, variables etc.) may be required in orderfor a computer system configured for generating a manufacturingdefinition of an integrated circuit to execute code defining anintegrated circuit so as to generate the manufacturing definition ofthat integrated circuit.

An example of processing an integrated circuit definition dataset at anintegrated circuit manufacturing system so as to configure the system tomanufacture a graphics processing unit will now be described withrespect to FIG. 5 .

FIG. 5 shows an example of an integrated circuit (IC) manufacturingsystem 502 which comprises a layout processing system 504 and anintegrated circuit generation system 506. The IC manufacturing system502 is configured to receive an IC definition dataset (e.g. defining agraphics processing unit as described in any of the examples herein),process the IC definition dataset, and generate an IC according to theIC definition dataset (e.g. which embodies a graphics processing unit asdescribed in any of the examples herein). The processing of the ICdefinition dataset configures the IC manufacturing system 502 tomanufacture an integrated circuit embodying a graphics processing unitas described in any of the examples herein.

The layout processing system 504 is configured to receive and processthe IC definition dataset to determine a circuit layout. Methods ofdetermining a circuit layout from an IC definition dataset are known inthe art, and for example may involve synthesising RTL code to determinea gate level representation of a circuit to be generated, e.g. in termsof logical components (e.g. NAND, NOR, AND, OR, MUX and FLIP-FLOPcomponents). A circuit layout can be determined from the gate levelrepresentation of the circuit by determining positional information forthe logical components. This may be done automatically or with userinvolvement in order to optimise the circuit layout. When the layoutprocessing system 504 has determined the circuit layout it may output acircuit layout definition to the IC generation system 506. A circuitlayout definition may be, for example, a circuit layout description.

The IC generation system 506 generates an IC according to the circuitlayout definition, as is known in the art. For example, the ICgeneration system 506 may implement a semiconductor device fabricationprocess to generate the IC, which may involve a multiple-step sequenceof photo lithographic and chemical processing steps during whichelectronic circuits are gradually created on a wafer made ofsemiconducting material. The circuit layout definition may be in theform of a mask which can be used in a lithographic process forgenerating an IC according to the circuit definition. Alternatively, thecircuit layout definition provided to the IC generation system 506 maybe in the form of computer-readable code which the IC generation system506 can use to form a suitable mask for use in generating an IC.

The different processes performed by the IC manufacturing system 502 maybe implemented all in one location, e.g. by one party. Alternatively,the IC manufacturing system 502 may be a distributed system such thatsome of the processes may be performed at different locations, and maybe performed by different parties. For example, some of the stages of:(i) synthesising RTL code representing the IC definition dataset to forma gate level representation of a circuit to be generated, (ii)generating a circuit layout based on the gate level representation,(iii) forming a mask in accordance with the circuit layout, and (iv)fabricating an integrated circuit using the mask, may be performed indifferent locations and/or by different parties.

In other examples, processing of the integrated circuit definitiondataset at an integrated circuit manufacturing system may configure thesystem to manufacture a graphics processing unit without the ICdefinition dataset being processed so as to determine a circuit layout.For instance, an integrated circuit definition dataset may define theconfiguration of a reconfigurable processor, such as an FPGA, and theprocessing of that dataset may configure an IC manufacturing system togenerate a reconfigurable processor having that defined configuration(e.g. by loading configuration data to the FPGA).

In some embodiments, an integrated circuit manufacturing definitiondataset, when processed in an integrated circuit manufacturing system,may cause an integrated circuit manufacturing system to generate adevice as described herein. For example, the configuration of anintegrated circuit manufacturing system in the manner described abovewith respect to FIG. 5 by an integrated circuit manufacturing definitiondataset may cause a device as described herein to be manufactured.

In some examples, an integrated circuit definition dataset could includesoftware which runs on hardware defined at the dataset or in combinationwith hardware defined at the dataset. In the example shown in FIG. 5 ,the IC generation system may further be configured by an integratedcircuit definition dataset to, on manufacturing an integrated circuit,load firmware onto that integrated circuit in accordance with programcode defined at the integrated circuit definition dataset or otherwiseprovide program code with the integrated circuit for use with theintegrated circuit.

The applicant hereby discloses in isolation each individual featuredescribed herein and any combination of two or more such features, tothe extent that such features or combinations are capable of beingcarried out based on the present specification as a whole in the lightof the common general knowledge of a person skilled in the art,irrespective of whether such features or combinations of features solveany problems disclosed herein. In view of the foregoing description itwill be evident to a person skilled in the art that variousmodifications may be made within the scope of the invention.

What is claimed is:
 1. A machine-implemented method of graphicsprocessing, comprising: for each of a plurality of low-level probepositions within a scene, determining directional lightingrepresentations at its position by incorporating data from one or moredirectional representations of lighting for first probe positions withinthe scene; using the directional representations of lighting for thelow-level probe positions to determine lighting indications for visiblesurfaces of the scene for pixels in a frame; and shading the pixels inthe frame in accordance with the determined lighting indications.
 2. Themachine-implemented method of claim 1, wherein the first probe positionsare high-level probe positions.
 3. The machine-implemented method ofclaim 1, wherein the first probe positions are global probe positionsand the low-level probe positions are local probe positions.
 4. Themachine-implemented method of claim 1, wherein the density of low-levelprobe positions is greater than the density of first probe positionswithin a local region of world-space.
 5. The machine-implemented methodof claim 1, wherein said using the directional representations oflighting for the low-level probe positions to determine lightingindications for the visible surfaces of the scene for pixels in theframe comprises, for a particular pixel, interpolating in two dimensionsbetween the directional representations of lighting for a set oflow-level probe positions.
 6. The machine-implemented method of claim 5,further comprising selecting low-level probe positions for saidinterpolation based on a similarity between the low-level probepositions and the visible surface at the particular pixel in terms ofthe world-space position and/or depth from the viewpoint for the frame.7. The machine-implemented method of claim 6, wherein the similarity isused as a weighting factor in said interpolation.
 8. Themachine-implemented method of claim 1, wherein the directionalrepresentations of lighting are defined in terms of spherical harmoniccomponents.
 9. The machine-implemented method of claim 1, wherein adirectional representation of lighting at a low-level probe position isdetermined based on a weighting of directional representations oflighting for one or more nearby first probe positions.
 10. Themachine-implemented method of claim 9, wherein the one or more nearbyfirst probe positions are those first probe positions within a distancethreshold and which are visible from the low-level probe position. 11.The machine-implemented method of claim 10, wherein ray tracing is usedto determine which of the first probe positions are visible from thelow-level probe position.
 12. A graphics processing unit configured torender a sequence of frames, the graphics processing unit comprising:processing logic configured to: for each of a plurality of low-levelprobe positions within a scene, determine directional lightingrepresentations at its position by incorporating data from one or moredirectional representations of lighting for first probe positions withinthe scene; use the directional representations of lighting for thelow-level probe positions to determine lighting indications for visiblesurfaces of the scene for pixels in a frame; and shade the pixels in theframe in accordance with the determined lighting indications.
 13. Thegraphics processing unit of claim 12, wherein the first probe positionsare high-level probe positions.
 14. The graphics processing unit ofclaim 12, wherein the first probe positions are global probe positionsand the low-level probe positions are local probe positions.
 15. Thegraphics processing unit of claim 12, wherein the density of low-levelprobe positions is greater than the density of first probe positionswithin a local region of world-space.
 16. The graphics processing unitof claim 12, wherein the processing logic is configured to use thedirectional representations of lighting for the low-level probepositions to determine lighting indications for the visible surfaces ofthe scene for pixels in the frame by, for a particular pixel,interpolating in two dimensions between the directional representationsof lighting for a set of low-level probe positions.
 17. The graphicsprocessing unit of claim 16, wherein the processing logic is configuredto select low-level probe positions for said interpolation based on asimilarity between the low-level probe positions and the visible surfaceat the particular pixel in terms of the world-space position and/ordepth from the viewpoint for the frame.
 18. The graphics processing unitof claim 12, wherein the processing logic is configured to determine adirectional representation of lighting at a low-level probe position isbased on a weighting of directional representations of lighting for oneor more nearby first probe positions.
 19. The graphics processing unitof claim 18, wherein the one or more nearby first probe positions arethose first probe positions within a distance threshold and which arevisible from the low-level probe position.
 20. A non-transitory computerreadable storage medium having stored thereon processor executableinstructions that when executed cause at least one processor to: foreach of a plurality of low-level probe positions within a scene,determine directional lighting representations at its position byincorporating data from one or more directional representations oflighting for first probe positions within the scene; use the directionalrepresentations of lighting for the low-level probe positions todetermine lighting indications for visible surfaces of the scene forpixels in a frame; and shade the pixels in the frame in accordance withthe determined lighting indications.